package cn.bdqn.tools;

import java.util.List;

public class Page {
    private int totalPageCount;// 总页面	
	private int pageSize = 5;// 页面大小，及每页显示的个数
	private int currPageNo;// 当前页码	
	private int totalCount;//记录总数
	private List<?> list;	// 集合
	private List<Integer> nums;

	public List<Integer> getNums() {
		return nums;
	}

	public void setNums(List<Integer> nums) {

		int falg = totalPageCount>5? 5:totalPageCount;

		for (Integer i = currPageNo ; i<=falg;i++){
			nums.add(i);
		}

}

	public int getTotalPageCount() {
		return totalPageCount;
	}

	public void setTotalPageCount(int totalPageCount) {
		this.totalPageCount = totalPageCount;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		if(totalCount>0){	
			this.totalCount = totalCount;
			//计算总页数
			totalPageCount=this.totalCount% pageSize==0? (this.totalCount/pageSize):(this.totalCount/pageSize+1);
		}
		
	}
	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		if (pageSize > 0) {
			this.pageSize = pageSize;
		}

	}

	public int getCurrPageNo() {
		if (currPageNo == 0) {
			return 0;
		}
		return currPageNo;
	}

	public void setCurrPageNo(int currPageNo) {
		if (currPageNo > 0) {
			this.currPageNo = currPageNo;
		}

	}

	public List<?> getList() {
		return list;
	}

	public void setList(List<?> list) {
		this.list = list;
	}
}
